<?php
/**
 * --------------------------------------------------------------
 * 通用基础控制器
 * --------------------------------------------------------------
 * Light Year Doc
 * @author yinq<3331653644@qq.com>
 * --------------------------------------------------------------
 */
namespace app\common\controller;

use think\Controller;
use app\admin\model\Config as CongfigModel;

class Base extends Controller
{
    protected function initialize()
    {
        parent::initialize();
        $this->initConfig();

    }

    /**
     * 初始化网站配置信息
     */
    protected function initConfig()
    {
        $system_config = cache('system_config');
        if (!$system_config) {
            $system_config = CongfigModel::getConfig();
            // 非开发模式，缓存系统配置
            if ($system_config['develop_mode'] == 0) {
                cache('system_config', $system_config);
            }
        }
        
        config('app.app_trace', (boolean)$system_config['app_trace']);
        config('site_setting', $system_config);
    }

    /**
     * 空操作
    public function _empty()
    {
		header("HTTP/1.0 404 Not Found");
        
        $template = '/index/404';
        
        $this->assign([
            'seo_title' => '404 - ' . config('app.site_setting.web_site_title'),
        ]);
	    return $this->fetch($template);
    }
     */
}